package com.xingda.packing.enums;

import lombok.Getter;

public enum LogType {
    ALL(0, "ALL"),
    INFO(1, "INFO"),
    WARN(2, "WARN"),
    ERROR(3, "ERROR");

    public static LogType getById(Integer id) {
        for (LogType value : LogType.values()) {
            if (value.getTypeId().equals(id)) {
                return value;
            }
        }
        return null;
    }

    LogType(Integer typeId, String typeName) {
        this.typeId = typeId;
        this.typeName = typeName;
    }

    @Getter
    private final Integer typeId;

    @Getter
    private final String typeName;
}
